//
//  MCExplainViewController.swift
//  WisdomSpace
//
//  Created by goulela on 2017/9/6.
//  Copyright © 2017年 MC. All rights reserved.
//

import UIKit

class MCExplainViewController: MCViewController {

    @objc var titleStr : String = ""
    @objc var code : String = ""
    @objc var type : String = ""
    
    
    
    override func viewDidLoad() {
        super.viewDidLoad()

        title = titleStr
        
        view.addSubview(contentTextView)
        contentTextView.snp.remakeConstraints { (make) -> Void in
            make.edges.equalTo(view).inset(UIEdgeInsetsMake(5, 5, 5, 5))
        }
        
        
        
        let para = [
            "code" : code,
            "type" : type
            ] as [String : Any]
        
        MCNetwork_post(url: JAVA_getCaption, para: para as [String : AnyObject], vc: self, hudSuperView: self.view, isHiddenTabbar: false, success: { (response) in
            
            let dataDict = response["data"] as! [String:Any]
            let value = dataDict["value"] as! String
            self.contentTextView.attributedText = value.MCAttributedString_lineSpace(lineSpace: 5)
            
        }, dislike: { (response) in }) { (error) in }
    }
    
    
    private lazy var contentTextView: UITextView = {
        let textView = UITextView()
        textView.font = MCFont(16)
        textView.textColor = UIColor.MCWords
        textView.showsVerticalScrollIndicator = false
        textView.isEditable = false
        return textView
    }()
    
}
